<%-- 
    Document   : ConsultaProfissao
    Created on : May 29, 2011, 12:36:20 AM
    Author     : diogo
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>




<script type="text/javascript">

	var cProf = null;
	var CurrentOnloadFunction = window.onload;


	/**
	 * instancia o ajax pra profissao
	 */
	function createCProf(){
			cProf = new AjaxConnection("consultas/Profissao.jsp");
			cProf.setOutput(document.getElementById("output_profissao"));
	}

	// verifica para criar funcao sem sobrescrever
	if (CurrentOnloadFunction != null) {
		window.onload = function(){
			CurrentOnloadFunction();
			createCProf();
		}
	}
	else {
		window.onload = function(){
			createCProf();
		}
	}

	/*
	alert(CurrentOnloadFunction)
	window.onload = function(){

		//cArea = new AjaxConnection("consultas/Area.jsp");
		//cArea.setOutput(document.getElementById("output_area"));
		
		cProf = new AjaxConnection("consultas/Profissao.jsp");
		cProf.setOutput(document.getElementById("output_profissao"));
	}
	//*/

	// botao consultar
	function consultarProfissao(){
		cProf.setParameter("filtro_tipo_profissao", document.getElementById("filtro_tipo_profissao").value);
		cProf.setParameter("AreaCodArea", document.getElementById("AreaCodArea").value);
		cProf.startConnection();
	}
</script>



<!--ja carrega -->
<script type="text/javascript">
	setTimeout(consultarProfissao, 1500);
	cProf.SetLoading();
</script>

<!--
<div id="output_area">

</div>
-->